cmake_minimum_required(VERSION 3.5.1)
project(Test)

set(CMAKE_CXX_STANDARD 11)

if(NOT DEFINED ENV{MX_SDK_HOME})
    message(FATAL_ERROR "MX_SDK_HOME is not defined, please set it first.")
else()
    set(MX_SDK_HOME $ENV{MX_SDK_HOME})
    message("MX_SDK_HOME=$ENV{MX_SDK_HOME}")
endif()
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
add_definitions(-Dgoogle=mindxsdk_private)
set(TARGET_NAME mxVisionMultiThread)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pthread")
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)
include_directories(${MX_SDK_HOME}/include)
include_directories(${MX_SDK_HOME}/opensource/include)
include_directories(${MX_SDK_HOME}/opensource/include/opencv4)
include_directories(${MX_SDK_HOME}/opensource/include/gstreamer-1.0)
include_directories(${MX_SDK_HOME}/opensource/include/glib-2.0)
include_directories(${MX_SDK_HOME}/opensource/lib/glib-2.0/include)

link_directories(${MX_SDK_HOME}/lib)
link_directories(${MX_SDK_HOME}/opensource/lib)

link_directories(/usr/local/Ascend/ascend-toolkit/latest/acllib/lib64)

add_executable(${TARGET_NAME} main.cpp)
target_link_libraries(${TARGET_NAME} mxbase plugintoolkit mxpidatatype streammanager glog mindxsdk_protobuf opencv_world)
